﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="order_add01.aspx.cs" Inherits="WebSite.admin.order.order_add01" %>
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>叶盟实业后台管理系统</title>
    <link href="../main.css" rel="stylesheet" type="text/css" />
    <script language="javascript">
        parent.maintitle.innerHTML = "定单管理";
        parent.contentmain.innerHTML = "<span class='title01'>所在位置：</span>添加定单 - 选择商品。&nbsp;&nbsp;<img src='images/sort_desc.gif' /> <a href='order/order.aspx' target='content'><font color=#ff0000>定单列表</font></a>"
    </script>
    <script language='javascript'>
        var path = (window.top.location).toString();
        if (path.indexOf('login.aspx') == -1) {
            if (path.indexOf('index.aspx') == -1) {
                window.top.location = 'index.aspx';
            }
        }
	</script>
	<script type="text/javascript" language="javascript">
	    function CheckSelect(del, str) {
	        var rt = true;
	        var num = 0;
	        var boxorder = 0;
	        var objCheckBox;
	        for (var i = 0; i < form1.length; i++) {
	            if (form1.elements[i].type == "checkbox") {
	                boxorder++;
	                objCheckBox = form1.elements[i];
	                if (objCheckBox.checked) {
	                    if (boxorder > 1) {
	                        num++;
	                    }
	                }
	            }
	        }
	        if (!del) {
	            if (num > 1) {
	                alert("此操作不允许选择多个事件");
	                rt = false;
	            }
	        }
	        if (str == 'del') {
	            if (num == 0) {
	                alert("没有要购买的商品信息");
	                rt = false
	            } else { return confirm('你确定要购买这些商品吗?'); }
	        }
	        else {
	            if (str == 'update') {
	                if (num == 0) {
	                    alert("你没有选择要更新的信息");
	                    rt = false
	                } else { return confirm('你确定要更新这些信息吗?'); }
	            } 
	        }
	        return rt;
	    }

	    function SelectAll(sa) {
	        ///全选/全消
	        var objCheckBox;
	        for (var i = 0; i < form1.length; i++) {
	            if (form1.elements[i].type == "checkbox") {
	                objCheckBox = form1.elements[i];
	                objCheckBox.checked = sa;
	            }
	        }
	    }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <center>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#F1F4F7">
<tr>
<td height="382" align="center" valign="top">
<br />
<asp:GridView ID="GridView1" runat="server" Width="98%" CellPadding="4" ForeColor="#333333" DataKeyNames="carid" AutoGenerateColumns="False" AllowPaging="True" pagesize="8" BorderStyle="Solid" BorderWidth="1px" OnRowDataBound="GridView1_RowDataBound"
      ShowFooter="false" EmptyDataText="没有数据记录！！" AllowSorting="True">
        <Columns>
        <asp:TemplateField ShowHeader="False" HeaderText="选择">
                 <HeaderTemplate>
                     <asp:CheckBox ID="CheckBox1" runat="server" Checked=true></asp:CheckBox>
                 </HeaderTemplate>
                 <ItemTemplate>
                     <asp:CheckBox ID="CheckBox1" runat="server" Checked=true></asp:CheckBox>
                 </ItemTemplate>
                </asp:TemplateField>  
        <asp:BoundField HeaderText="商品名称" DataField="proname" sortexpression="proname" />
        <asp:BoundField HeaderText="货号" DataField="procode" sortexpression="procode" />
        <asp:TemplateField ShowHeader="False" HeaderText="价格">
           <ItemTemplate>
             <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("price") %>' Width="60px"></asp:TextBox>
           </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False" HeaderText="数量">
           <ItemTemplate>
             <asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval("pronum") %>' Width="60px"></asp:TextBox>
           </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False" HeaderText="备注">
           <ItemTemplate>
             <asp:TextBox ID="TextBox3" runat="server" Text='<%# Eval("contents") %>' Width="60px"></asp:TextBox>
           </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField HeaderText="小计" DataField="price" sortexpression="price" />
        <asp:BoundField HeaderText="" DataField="pronum" sortexpression="pronum" />
        <asp:TemplateField ShowHeader="False" HeaderText="操作">
            <ItemTemplate>
              <a title="移除" href="order_add01.aspx?action=del&amp;cid=<%# Eval("carid") %>&amp;memberid=<%=Request.QueryString["memberid"] %>&amp;temp=<%=Request.QueryString["temp"] %>"><img height="16" src="../images/icon_drop.gif" width="16" border="0" /></a>
            </ItemTemplate>
        </asp:TemplateField>
        </Columns>
             <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />             
             <PagerStyle BackColor="White" ForeColor="#333333" HorizontalAlign="Center" Font-Bold="True" Font-Size=30px />
             <HeaderStyle BackColor="#E2E7EB" Font-Bold="True" ForeColor="Black" HorizontalAlign="Left" />
             <AlternatingRowStyle BackColor="White" />
             <PagerSettings Visible="False" />
    </asp:GridView>
<table width="90%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td colspan="4"><span class="require-field">备注：商品价格中已包含属性加价</span></td>
    <td align="right"><strong>合计：</strong></td>
    <td align="right">
        <asp:Label ID="totalprice" runat="server" Text=""></asp:Label></td>
    <td><asp:Button ID="Button2" runat="server" Text="更新商品" OnClick="Button2_Click" /></td>
  </tr>
</table>
  <br />
<table width="90%" border="0" cellspacing="0" cellpadding="3">
  <tr><td>
      按商品名称或商品货号搜索
      <input type="text" name="keyname" id="keyname" runat="server" />
  <asp:ImageButton ID="ImageButton1" ImageUrl="../images/button04.gif" runat="server" OnClick="ImageButton1_Click" />
  <asp:DropDownList ID="proid" runat="server"></asp:DropDownList>
</td></tr></table>
<table width="90%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <th width="100">商品名称</th>
    <td>&nbsp;<asp:Label ID="proname" runat="server" Text=""></asp:Label></td>
  </tr>
  <tr>
    <th>货号</th>
    <td>&nbsp;<asp:Label ID="procode" runat="server" Text=""></asp:Label></td>
  </tr>
  <tr>
    <th>分类</th>
    <td>&nbsp;<asp:Label ID="typeid" runat="server" Text=""></asp:Label></td>
  </tr>
  <tr>
    <th>品牌</th>
    <td>&nbsp;<asp:Label ID="propinpai" runat="server" Text=""></asp:Label></td>
  </tr>
  <tr>
    <th>价格</th>
    <td><asp:RadioButtonList ID="price" runat="server"></asp:RadioButtonList></td>
  </tr>
  <tr>
    <th>数量</th>
    <td>&nbsp;<input name="pronum" type="text" value="1" id="pronum" runat="server" size="10"></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><asp:Button ID="Button1" runat="server" Text="加入定单" OnClick="Button1_Click" /></td>
  </tr>
</table>
  <p align="center"><asp:ImageButton ID="ImageButton2" ImageUrl="../images/button16.gif" runat="server" OnClick="ImageButton2_Click" />
       <a href="order.aspx"><img src="../images/button12.gif" border="0" /></a>
  </p>
  </td>
</tr>
</table>
</center>
    </div>
    </form>
</body>
</html>
